clang-tidy modernize-use-auto, but (#483)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Wed, 29 Jan 2020 15:32:32 +0000 (08:32 -0700)
committerGitHub <noreply@github.com>
Wed, 29 Jan 2020 15:32:32 +0000 (08:32 -0700)
only on:
Message: use auto when initializing with new to avoid duplicating the type name

not on:
Message: use auto when initializing with a cast to avoid duplicating the type name
Message: use auto when initializing with a template cast to avoid duplicating the

The later two left me wondering what type I had, while it is obvious with the first
one.  Some of this is due to our macro defines for gbffetuint*, gbfputuint*.

This required a edit of the fixes file produced by clang-tidy:
export PAT='with a template' A=3 B=3
vim -Nes "+g/${PAT}/.-${B},.+${A}d" '+w !tee' '+q!' ct8fixes.yaml > tmp1.yaml
export PAT='with a cast' A=2 B=3
vim -Nes "+g/${PAT}/.-${B},.+${A}d" '+w !tee' '+q!' tmp1.yaml > myfixes.yaml
rm ct8fixes.yaml
rm tmp1.yaml

82 files changed:
alan.cc
an1.cc
arcdist.cc
bcr.cc
bend.cc
bushnell.cc
bushnell_trl.cc
compegps.cc
delgpl.cc
destinator.cc
dg-100.cc
dmtlog.cc
easygps.cc
enigma.cc
exif.cc
f90g_track.cc
g7towin.cc
garmin.cc
garmin_fs.cc
garmin_gpi.cc
garmin_txt.cc
garmin_xt.cc
gdb.cc
ggv_log.cc
globalsat_sport.cc
gnav_trl.cc
googledir.cc
gopal.cc
gpsutil.cc
gtrnctr.cc
holux.cc
humminbird.cc
igc.cc
igo8.cc
interpolate.cc
itracku.cc
jogmap.cc
jtr.cc
kml.cc
lowranceusr.cc
maggeo.cc
magproto.cc
mapasia.cc
mapbar_track.cc
mapsend.cc
mapsource.cc
mmo.cc
mtk_logger.cc
mynav.cc
navicache.cc
naviguide.cc
navilink.cc
navitel.cc
netstumbler.cc
nmn4.cc
osm.cc
ozi.cc
pocketfms_bc.cc
pocketfms_wp.cc
psitrex.cc
raymarine.cc
sbn.cc
skyforce.cc
skytraq.cc
tef_xml.cc
teletype.cc
tiger.cc
tmpro.cc
tpg.cc
tpo.cc
transform.cc
unicsv.cc
v900.cc
vidaone.cc
vitosmt.cc
vitovtt.cc
vpl.cc
wbt-200.cc
wfff_xml.cc
wintec_tes.cc
xcsv.cc
xmltag.cc

diff --git a/alan.cc b/alan.cc
index 7e1da88a901794f20e3ab84975aeebb58b691e41..bd53438034016184e006ff71eb8dd60891dd393a 100644 (file)
--- a/alan.cc
+++ b/alan.cc
@@ -484,7 +484,7 @@ static Waypoint* get_wpt(struct wprdata* wprdata, unsigned n)
   }
   struct wpt* wpt = &(wprdata->wpt[idx]);
 
-  Waypoint* WP = new Waypoint;
+  auto* WP = new Waypoint;
   WP->latitude  = -pt2deg(wpt->pt.y);
   WP->longitude =  pt2deg(wpt->pt.x);
   WP->SetCreationTime(unpack_time(wpt->date, wpt->time));
@@ -612,7 +612,7 @@ static void trl_read()
     /* track points */
     struct trklog* trklog = &(trldata.trklog[i]);
     for (j=0; j<trkhdr->totalpt; j++) {
-      Waypoint* WP = new Waypoint;
+      auto* WP = new Waypoint;
       WP->latitude  = -pt2deg(trklog->pt[j].y);
       WP->longitude =  pt2deg(trklog->pt[j].x);
       WP->altitude  =  hgt2m(trklog->sh[j].height);
diff --git a/an1.cc b/an1.cc
index 80c34bc5e6f5cfb1f18b5c2e01e24457dd7bad4e..c6b9504d3564dec869d2e7d08d2de671b7259880 100644 (file)
--- a/an1.cc
+++ b/an1.cc
@@ -662,7 +662,7 @@ static void Read_AN1_Waypoints(gbfile* f)
   for (unsigned long i = 0; i < count; i++) {
     an1_waypoint_record* rec = Alloc_AN1_Waypoint();
     Read_AN1_Waypoint(f, rec);
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     if (rec->creation_time) {
       wpt_tmp->SetCreationTime(rec->creation_time);
@@ -822,7 +822,7 @@ static void Read_AN1_Lines(gbfile* f)
       Read_AN1_Vertex(f, vert);
 
       /* create route point */
-      Waypoint* wpt_tmp = new Waypoint;
+      auto* wpt_tmp = new Waypoint;
       wpt_tmp->latitude = DecodeOrd(vert->lat);
       wpt_tmp->longitude = -DecodeOrd(vert->lon);
       wpt_tmp->shortname = QString::asprintf("\\%5.5lx", rtserial++);
index 328719aac0cd4b80c9f1d161c5de5750f33a8689..90c1e98c2d87f2d9de37087969c862d52da8c828 100644 (file)
@@ -114,8 +114,8 @@ void ArcDistanceFilter::process()
 
     gbfile* file_in = gbfopen(arcfileopt, "r", MYNAME);
 
-    Waypoint* arcpt1 = new Waypoint;
-    Waypoint* arcpt2 = new Waypoint;
+    auto* arcpt1 = new Waypoint;
+    auto* arcpt2 = new Waypoint;
     arcdist_arc_disp_hdr_cb(nullptr);
 
     arcpt2->latitude = arcpt2->longitude = BADVAL;
diff --git a/bcr.cc b/bcr.cc
index 21d684a98d238b4dd57a40dfe7f3ec410423cfa6..198c700d238ab77f2e906d8a16d817e3fd68c72f 100644 (file)
--- a/bcr.cc
+++ b/bcr.cc
@@ -271,7 +271,7 @@ bcr_data_read()
       fatal(MYNAME ": structure error at %s (Coordinates)!\n", station);
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->shortname = station;
     bcr_mercator_to_wgs84(mlat, mlon, &wpt->latitude, &wpt->longitude);
diff --git a/bend.cc b/bend.cc
index 65839d2ea729903fd8ee92912d40a9a56c1c21ad..182339aef918768992bfc41c23804137cf0c531a 100644 (file)
--- a/bend.cc
+++ b/bend.cc
@@ -68,7 +68,7 @@ Waypoint* BendFilter::create_wpt_dest(const Waypoint* wpt_orig, double lat_orig,
   linepart(lat_orig, long_orig, lat_orig_adj, long_orig_adj, frac,
            &lat_dest, &long_dest);
 
-  Waypoint* wpt_dest = new Waypoint(*wpt_orig);
+  auto* wpt_dest = new Waypoint(*wpt_orig);
   wpt_dest->latitude = DEG(lat_dest);
   wpt_dest->longitude = DEG(long_dest);
 
@@ -100,7 +100,7 @@ void BendFilter::process_route(const route_head* route_orig, route_head* route_d
 
     if (wpt_orig_prev == nullptr) {
       if (wpt_orig != nullptr) {
-        Waypoint* waypoint_dest = new Waypoint(*wpt_orig);
+        auto* waypoint_dest = new Waypoint(*wpt_orig);
         route_add_wpt(route_dest, waypoint_dest);
       }
     } else {
@@ -115,7 +115,7 @@ void BendFilter::process_route(const route_head* route_orig, route_head* route_d
 
       if (is_small_angle(lat_orig, long_orig, lat_orig_prev,
                          long_orig_prev, lat_orig_next, long_orig_next)) {
-        Waypoint* waypoint_dest = new Waypoint(*wpt_orig);
+        auto* waypoint_dest = new Waypoint(*wpt_orig);
         route_add_wpt(route_dest, waypoint_dest);
       } else {
         Waypoint* wpt_dest_prev = create_wpt_dest(wpt_orig,
@@ -139,7 +139,7 @@ void BendFilter::process_route(const route_head* route_orig, route_head* route_d
   }
 
   if (wpt_orig != nullptr) {
-    Waypoint* waypoint_dest = new Waypoint(*wpt_orig);
+    auto* waypoint_dest = new Waypoint(*wpt_orig);
     route_add_wpt(route_dest, waypoint_dest);
   }
 }
index 3cbec890d4cfa9fb9f2fd2f5e1fc896bca6dc2bc..dd1f6e1bb447203fca3640852c1da54575fe7b32 100644 (file)
@@ -197,7 +197,7 @@ wr_deinit()
 static void
 bushnell_read()
 {
-  Waypoint* wpt_tmp = new Waypoint;
+  auto* wpt_tmp = new Waypoint;
 
   int32_t lat_tmp = gbfgetint32(file_in);
   int32_t lon_tmp = gbfgetint32(file_in);
index a1cfef1e4e49f479500a6d57576446ad3ad59b92..acf80a6d1def6805d511b564a4d6386cce5cd29d 100644 (file)
@@ -102,7 +102,7 @@ bushnell_read()
       break;
     }
 
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
     wpt_tmp->latitude  = lat_tmp / 10000000.0;
     wpt_tmp->longitude = lon_tmp / 10000000.0;
 
index 23700762798d31e883ee98501058edf754a39b52..817b135af3471748169a930d9adee3a6f9a0ae7b 100644 (file)
@@ -155,7 +155,7 @@ parse_wpt(char* buff)
 {
   int col = -1;
   char* cx;
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
   struct tm tm;
   int has_time = 0;
   memset(&tm, 0, sizeof(tm));
@@ -272,7 +272,7 @@ parse_trkpt(char* buff)
 {
   int col = -1;
   struct tm tm;
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
 
   char* c = strstr(buff, "A ");
   if (c == buff) {
index 95415d8d25f9f75e88df705a311ad2109a109fe9..d6b6fa3a7e9b1cab65af5d76a44d8eeb1467875b 100644 (file)
--- a/delgpl.cc
+++ b/delgpl.cc
@@ -57,7 +57,7 @@ gpl_read()
   track_add_head(track_head);
 
   while (gbfread(&gp, sizeof(gp), 1, gplfile_in) > 0) {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
     wpt_tmp->latitude = le_read_double(&gp.lat);
     wpt_tmp->longitude = le_read_double(&gp.lon);
     double alt_feet = le_read_double(&gp.alt);
index 34852c3c05cdb41052a788c9ad1f5b8f45657f1d..63b07128ca33a64440d9b1b96cb8fed53afbaa48 100644 (file)
@@ -159,7 +159,7 @@ destinator_read_poi()
 
     count++;
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->shortname = read_wcstr();
     wpt->notes = read_wcstr();         /* comment */
@@ -231,7 +231,7 @@ destinator_read_rte()
 
     count++;
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->shortname = read_wcstr();
     wpt->notes = read_wcstr();
@@ -279,7 +279,7 @@ destinator_read_trk()
       break;
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->longitude = gbfgetdbl(fin);
     wpt->latitude = gbfgetdbl(fin);
index 183b66c79976482e899052853a4603811177007c..429d0991205ee77fbc92f9217ed39ed3f269d42c 100644 (file)
--- a/dg-100.cc
+++ b/dg-100.cc
@@ -270,7 +270,7 @@ process_gpsfile(uint8_t data[], route_head** track)
       track_add_head(*track);
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     float latitude = bin2deg(lat);
     if (latitude >= 100) {
       manual_point = 1;
index a11f9730fb6b18956dbc2330c7f3a43b166ef53c..bac604738987ea95c88538378f54fdc337df2e26 100644 (file)
--- a/dmtlog.cc
+++ b/dmtlog.cc
@@ -449,7 +449,7 @@ read_CTrackFile(const int version)
       datum = read_datum(fin);
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->latitude = gbfgetdbl(fin);
     wpt->longitude = gbfgetdbl(fin);
@@ -496,7 +496,7 @@ read_CTrackFile(const int version)
       gbfungetc(i, fin);
       datum = read_datum(fin);
 
-      Waypoint* wpt = new Waypoint;
+      auto* wpt = new Waypoint;
 
       wpt->latitude = gbfgetdbl(fin);
       wpt->longitude = gbfgetdbl(fin);
@@ -523,7 +523,7 @@ read_CTrackFile(const int version)
   while (wcount > 0) {
     wcount--;
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->latitude = gbfgetdbl(fin);
     wpt->longitude = gbfgetdbl(fin);
index af401bfed78a81c8133b5807181f0a2f78d87f48..dde94f4b3f472462311fe0f693c82ec0aeed9814 100644 (file)
@@ -78,7 +78,7 @@ data_read()
   int p;
   char ibuf[10];
   do {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
     UrlLink link;
 
     for (int tag = gbfgetc(file_in); tag != 0xff; tag = gbfgetc(file_in)) {
index 699e6d55b63cfc3bfab79635e8881f6eebd286b8..36a33f82547513d2464170eae07c5e9be1b1d1c4 100644 (file)
--- a/enigma.cc
+++ b/enigma.cc
@@ -108,7 +108,7 @@ data_read()
   route_add_head(route);
 
   while (1 == gbfread(&ewpt, sizeof(ewpt), 1, file_in)) {
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     wpt->latitude = enigmaPositionToDec(le_read32(&ewpt.latitude));
     wpt->longitude = enigmaPositionToDec(le_read32(&ewpt.longitude));
     char*sn = xstrndup(ewpt.shortname, ewpt.shortname_len);
diff --git a/exif.cc b/exif.cc
index e58ecbde1fce6beaddbb83138d67183f89391616..69ed24bcc416a9c698a15e8c7ace2212ea4f060f 100644 (file)
--- a/exif.cc
+++ b/exif.cc
@@ -805,7 +805,7 @@ exif_waypt_from_exif_app(ExifApp* app)
     return nullptr;
   }
 
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
 
   wpt->latitude = unknown_alt;
   wpt->longitude = unknown_alt;
index 47fe8ae5986a36dc173120d50d750d5f6c86a227..cc2af43f0db8b0eba4e699d8caeaa61955cbb673 100644 (file)
@@ -118,7 +118,7 @@ f90g_track_read()
         && velocityMark == 'M') {
 
       // create the Waypoint and fill it in
-      Waypoint* readWaypoint = new Waypoint;
+      auto* readWaypoint = new Waypoint;
       QDateTime dt = QDateTime(QDate(year, mon, mday), QTime(hour, min, sec), Qt::UTC);
 
       readWaypoint->SetCreationTime(dt);
index 9e94ef4fc5552e418b608e55082d49cf88b5e941..cc16aa380aa896a344d3b5846e0805d6e7820cd6 100644 (file)
@@ -272,7 +272,7 @@ parse_waypt(char* buff)
   char* cin;
   struct tm tm;
 
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
   garmin_fs_p gmsd = garmin_fs_alloc(-1);
   fs_chain_add(&wpt->fs, (format_specific_data*) gmsd);
 
@@ -343,7 +343,7 @@ parse_waypt(char* buff)
 static Waypoint*
 parse_trkpt(char* buff)
 {
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
   garmin_fs_p gmsd = garmin_fs_alloc(-1);
   fs_chain_add(&wpt->fs, (format_specific_data*) gmsd);
 
index b53d70630a3d3cd5f9b9c81bbf68253c5171beed..59c9f6445265229bca4b77932daefcf796d22d84 100644 (file)
--- a/garmin.cc
+++ b/garmin.cc
@@ -385,7 +385,7 @@ waypt_read()
   GPS_PWay* way = nullptr;
 
   if (getposn) {
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     wpt->latitude = gps_save_lat;
     wpt->longitude = gps_save_lon;
     wpt->shortname = "Position";
@@ -401,7 +401,7 @@ waypt_read()
   }
 
   for (int i = 0; i < n; i++) {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     wpt_tmp->shortname = QString::fromLatin1(way[i]->ident);
     wpt_tmp->description = QString::fromLatin1(way[i]->cmnt);
@@ -532,7 +532,7 @@ track_read()
     if (array[i]->no_latlon || array[i]->ishdr) {
       continue;
     }
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->longitude = array[i]->lon;
     wpt->latitude = array[i]->lat;
@@ -602,7 +602,7 @@ route_read()
       if (array[i]->islink)  {
         continue;
       } else {
-        Waypoint* wpt_tmp = new Waypoint;
+        auto* wpt_tmp = new Waypoint;
         wpt_tmp->latitude = array[i]->lat;
         wpt_tmp->longitude = array[i]->lon;
         wpt_tmp->shortname = array[i]->ident;
@@ -786,7 +786,7 @@ pvt_init(const QString& fname)
 static Waypoint*
 pvt_read(posn_status* posn_status)
 {
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
   GPS_PPvt_Data pvt = GPS_Pvt_New();
 
   if (GPS_Command_Pvt_Get(&pvt_fd, &pvt)) {
index 291845b829eaa45c0986db3b3afa285c427f750a..973255f0813b71f8d192eac3d6fceda4f850512a 100644 (file)
@@ -37,7 +37,7 @@
 garmin_fs_t*
 garmin_fs_alloc(const int protocol)
 {
-  garmin_fs_t* result = new garmin_fs_t;
+  auto* result = new garmin_fs_t;
   result->fs.type = FS_GMSD;
   result->fs.copy = (fs_copy) garmin_fs_copy;
   result->fs.destroy = garmin_fs_destroy;
index 803f78b394296b38bbd317152619751752e335e2..9b6c5691d4e93407843ab1687cd692eb42ae3c75 100644 (file)
@@ -918,7 +918,7 @@ wdata_compute_size(writer_data_t* data)
       res += 10;  /* tag(4) */
     }
 
-    gpi_waypt_t* dt = new gpi_waypt_t;
+    auto* dt = new gpi_waypt_t;
     wpt->extra_data = dt;
 
     if (alerts) {
@@ -1261,7 +1261,7 @@ enum_waypt_cb(const Waypoint* ref)
     }
   }
 
-  Waypoint* wpt = new Waypoint(*ref);
+  auto* wpt = new Waypoint(*ref);
 
   if (*opt_unique == '1') {
     wpt->shortname = mkshort(short_h, wpt->shortname);
index b05283e93568f5dd0cb25addc38f76f89e13781c..0ea891feb4d725d8cd183f4c0f774aafdffd4ea5 100644 (file)
@@ -1089,7 +1089,7 @@ parse_waypoint()
 
   bind_fields(waypt_header);
 
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
   garmin_fs_p gmsd = garmin_fs_alloc(-1);
   fs_chain_add(&wpt->fs, (format_specific_data*) gmsd);
 
@@ -1262,7 +1262,7 @@ parse_track_waypoint()
   int column = -1;
 
   bind_fields(trkpt_header);
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
 
   while ((str = csv_lineparse(nullptr, "\t", "", column++))) {
     double x;
index fcd629813563ab443bc4880b3d482f9e7addf23b..f20f87abf24eb09083dea4b988af8c90acba51b6 100644 (file)
@@ -372,7 +372,7 @@ format_garmin_xt_proc_atrk()
     double AltF = (double)uu * GARMIN_XT_ELE - 1500;
 
     //create new waypoint
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     //populate wpt;
     wpt->latitude = LatF*180/16777216; /* Degrees */
diff --git a/gdb.cc b/gdb.cc
index a5106f6425ebeaa574c716e5f843d2901d25911a..1c9e7ea459c8368326395649a43d4345f2675886 100644 (file)
--- a/gdb.cc
+++ b/gdb.cc
@@ -690,7 +690,7 @@ read_route()
   for (int i = 0; i < points; i++) {
     char buf[128];
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     rtept_ct++;
 
     wpt->shortname = fread_cstr();     /* shortname */
@@ -875,7 +875,7 @@ read_track()
   int points = FREAD_i32;
 
   for (int index = 0; index < points; index++) {
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     trkpt_ct++;
 
@@ -989,7 +989,7 @@ read_data()
       wpt = read_waypoint(&wpt_class);
       if ((gdb_via == 0) || (wpt_class == 0)) {
         waypt_add(wpt);
-        Waypoint* dupe = new Waypoint(*wpt);
+        auto* dupe = new Waypoint(*wpt);
         wayptq_in.append(dupe);
       } else {
         wayptq_in_hidden.append(wpt);
@@ -1553,7 +1553,7 @@ write_waypoint_cb(const Waypoint* refpt)
 
   if (test == nullptr) {
     int display;
-    Waypoint* wpt = new Waypoint(*refpt);
+    auto* wpt = new Waypoint(*refpt);
 
     gdb_check_waypt(wpt);
     wayptq_out.append(wpt);
index 2d15b16c340af835783d07bc75b1476ad15e952f..011c56a3a31af953908cc9e6c1259c2d95fcb8b4 100644 (file)
@@ -124,7 +124,7 @@ ggv_log_read()
 
     memset(&tm, 0, sizeof(tm));
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     int deg = (int16_t) le_read16(&buf[0]);
     int min = le_read16(&buf[2]);
index f40aa00885df09fcb6debdd0f049f7a4c3db1ba2..ad3e6f2c0d2a0552eabfc7746a4630c726d68f14 100644 (file)
@@ -751,7 +751,7 @@ track_read()
                 printf(" PwrCadense:%d Power:%d\n", point.PwrCadence,point.Power);
               }
 
-              Waypoint* wpt = new Waypoint(); // waypt_new();
+              auto* wpt = new Waypoint(); // waypt_new();
               //wpt->creation_time = mkgmtime(&gpstime);
               wpt->SetCreationTime(gpsbabeltime);
               wpt->longitude = ((int32_t) point.Longitude) / 1000000.0;
index 425ae3c4746e4cbbaa273a1a86102209046c272c..c2295509fd00328ff10d3cda18fd25092579442a 100644 (file)
@@ -95,7 +95,7 @@ gnav_trl_read()
       fatal(MYNAME ": Unexpected EOF (end of file)!\n");
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->SetCreationTime(le_read32(&rec.time));
     wpt->latitude = le_read_float(&rec.lat);
index 7532f37e021ab1339f0f665f6487d67337d632e2..26e81f271762420582c4e347abb0023a5796a383 100644 (file)
@@ -117,7 +117,7 @@ goog_poly_e(xg_string args, const QXmlStreamAttributes*)
     lon += decode_goog64(qbstr, qbpos);
 
     {
-      Waypoint* wpt_tmp = new Waypoint;
+      auto* wpt_tmp = new Waypoint;
       wpt_tmp->latitude = lat / 100000.0;
       wpt_tmp->longitude = lon / 100000.0;
       route_add_wpt(routehead, wpt_tmp);
index c3c74ba9efad6006c10952922f5e86d979725586..bf211c0efa917e6bbb54e72362f9982fe22da141 100644 (file)
--- a/gopal.cc
+++ b/gopal.cc
@@ -200,7 +200,7 @@ gopal_read()
     if ((nfields == 8) && (tx == 0)) {
       // fatal(MYNAME ": Invalid date in filename \"%s\", try to set manually using \"date\" switch!\n", buff);
     }
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     int column = -1;
     // the format of gopal is quite simple. Unfortunately the developers forgot the date as the first element...
index ad3457b7c4f02ba77c51982ac654fcdc3a1a53ec..c9ccd17e8892bbad79fc4d13c8335b75564e2351 100644 (file)
@@ -110,7 +110,7 @@ data_read()
     rtrim(sn);
     rtrim(desc);
     rtrim(icon);
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
     wpt_tmp->altitude = alt;
     wpt_tmp->shortname = sn;
     xfree(sn);
index 492438e1f9bfeea82239e428ecd0aa9f846a6e95..f5a3a248aff58a852e2951c2cdb9d7c9156d44cc 100644 (file)
@@ -504,7 +504,7 @@ gtc_trk_pnt_e(xg_string, const QXmlStreamAttributes*)
       /* Add the first point of an ActivityLap as
       a waypoint as well as a trackpoint. */
       char cbuf[10];
-      Waypoint* wpt_lap_s = new Waypoint(*wpt_tmp);
+      auto* wpt_lap_s = new Waypoint(*wpt_tmp);
       snprintf(cbuf, sizeof(cbuf), "LAP%03d", lap_ct);
       wpt_lap_s->shortname = cbuf;
       waypt_add(wpt_lap_s);
index e172884b5cdaab3651c7f0a50b053607f37c2c41..63e856d35c6acac9560e40e082ae59a715e533eb 100644 (file)
--- a/holux.cc
+++ b/holux.cc
@@ -97,7 +97,7 @@ static void data_read()
 
   /* Get the waypoints */
   for (int iCount = 0; iCount < iWptNum ; iCount ++) {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     int iWptIndex = le_read16(&((WPTHDR*)HxWpt)->idx[iCount]);
     WPT* pWptHxTmp = (WPT*)&HxWpt[OFFS_WPT + (sizeof(WPT) * iWptIndex)];
index 562049bd3b0eb23ba6ab08b544d2f0f710449be0..15f72b69b3cc7f180d6f5728ff68e2d06997a8ad 100644 (file)
@@ -279,7 +279,7 @@ humminbird_read_wpt(gbfile* fin)
 
   /* All right! Copy the data to the gpsbabel struct... */
 
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
 
   // Could probably find a way to eliminate the alloc/copy.
   char* s = xstrndup(w.name, sizeof(w.name));
@@ -422,7 +422,7 @@ humminbird_read_track(gbfile* fin)
 
   /* We create one wpt for the info in the header */
 
-  Waypoint* first_wpt = new Waypoint;
+  auto* first_wpt = new Waypoint;
   double g_lat = gudermannian_i1924(accum_north);
   first_wpt->latitude  = geocentric_to_geodetic_hwr(g_lat);
   first_wpt->longitude = accum_east/EAST_SCALE * 180.0;
@@ -431,7 +431,7 @@ humminbird_read_track(gbfile* fin)
   track_add_wpt(trk, first_wpt);
 
   for (int i = 0 ; i<th.num_points-1 ; i++) {
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     points[i].depth      = be_read16(&points[i].depth);
     points[i].deltaeast  = be_read16(&points[i].deltaeast);
@@ -532,7 +532,7 @@ humminbird_read_track_old(gbfile* fin)
 
   /* We create one wpt for the info in the header */
 
-  Waypoint* first_wpt = new Waypoint;
+  auto* first_wpt = new Waypoint;
   double g_lat = gudermannian_i1924(accum_north);
   first_wpt->latitude  = geocentric_to_geodetic_hwr(g_lat);
   first_wpt->longitude = accum_east/EAST_SCALE * 180.0;
@@ -540,7 +540,7 @@ humminbird_read_track_old(gbfile* fin)
   track_add_wpt(trk, first_wpt);
 
   for (int i = 0 ; i<th.num_points-1 ; i++) {
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     points[i].deltaeast  = be_read16(&points[i].deltaeast);
     points[i].deltanorth = be_read16(&points[i].deltanorth);
diff --git a/igc.cc b/igc.cc
index f41acd666e94e6051b30aec612675592ca540fc8..160f6078e650c8dcf8e4d7cb55c85ff3e0b0d98a 100644 (file)
--- a/igc.cc
+++ b/igc.cc
@@ -215,7 +215,7 @@ static void igc_task_rec(const char* rec)
     fatal(MYNAME ": task waypoint (C) record parse error\n%s", rec);
   }
 
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
   wpt->latitude = ('N' == lat_hemi[0] ? 1 : -1) *
                   (lat_deg + (lat_min * 1000 + lat_frac) / 1000.0 / 60);
 
diff --git a/igo8.cc b/igo8.cc
index 0a922327c026b503173942aec6b840bf9c758074..54005addf1ecdd71f6993ad6f20063d64b999163 100644 (file)
--- a/igo8.cc
+++ b/igo8.cc
@@ -171,7 +171,7 @@ static void igo8_read()
   while (in_point_count &&
          gbfread(&point, sizeof(point), 1, igo8_file_in) > 0) {
     in_point_count--;
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     wpt_tmp->latitude = le_read32(&point.lat) / (double)0x800000;
     wpt_tmp->longitude = le_read32(&point.lon) / (double)0x800000;
index 1c98c50a7c3d82f5ae29c3b642261fccd98d0528..9547688c384d4f46437e0b162c75365d409ab5f1 100644 (file)
@@ -75,7 +75,7 @@ void InterpolateFilter::process()
           for (unsigned int timen = time1+interval;
                timen < wpt->creation_time.toTime_t();
                timen += interval) {
-            Waypoint* wpt_new = new Waypoint(*wpt);
+            auto* wpt_new = new Waypoint(*wpt);
             wpt_new->SetCreationTime(timen);
             wpt_new->shortname = QString();
             wpt_new->description = QString();
@@ -106,7 +106,7 @@ void InterpolateFilter::process()
             for (double distn = dist;
                  distn < curdist;
                  distn += dist) {
-              Waypoint* wpt_new = new Waypoint(*wpt);
+              auto* wpt_new = new Waypoint(*wpt);
               frac = distn / curdist;
               wpt_new->SetCreationTime(frac * (wpt->creation_time.toTime_t() - time1) + time1);
               wpt_new->shortname = QString();
index 753632a4d6e97e0dcb0d66a565f22c5e476fa37b..dbab699a92fd0bede23f3b421cb1e16f66786b9c 100644 (file)
@@ -303,7 +303,7 @@ encode_itracku_time(time_t time)
 static Waypoint*
 to_waypoint(itracku_data_record* d)
 {
-  Waypoint* wp = new Waypoint;
+  auto* wp = new Waypoint;
   wp->longitude = deg_min_to_deg(le_read32(d->longitude));
   wp->latitude = deg_min_to_deg(le_read32(d->latitude));
   wp->SetCreationTime(decode_itracku_time(le_read32(d->creation_time)));
@@ -710,7 +710,7 @@ gprmc_parse(char* ibuf)
   dmy = dmy / 100;
   tm.tm_mday = dmy;
 
-  Waypoint* waypt = new Waypoint;
+  auto* waypt = new Waypoint;
 
   WAYPT_SET(waypt, speed, KNOTS_TO_MPS(speed));
 
index 630212d3da6cf362e49da0440f2946057c8b6d38..4dbe229585d6b3f1eccfb81a46cea33f36df6e6b 100644 (file)
--- a/jogmap.cc
+++ b/jogmap.cc
@@ -51,7 +51,7 @@ jogmap_markers(xg_string, const QXmlStreamAttributes*)
 static void
 jogmap_marker(xg_string, const QXmlStreamAttributes* attrv)
 {
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
 
   if (attrv->hasAttribute("lat")) {
     wpt->latitude = attrv->value("lat").toString().toDouble();
diff --git a/jtr.cc b/jtr.cc
index 19e7f3013cf468afda54238692cd7a8a5a9b2bf4..e4a5b90fec9331ab90e9f1a50fe0cb3088699006 100644 (file)
--- a/jtr.cc
+++ b/jtr.cc
@@ -206,7 +206,7 @@ jtr_read()
       continue;
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->latitude = lat;
     wpt->longitude = lon;
diff --git a/kml.cc b/kml.cc
index da43ac2765d33956ec8f859e1f8b48ce8984902d..f017872c887f48005fa16a369269fcb62165e745 100644 (file)
--- a/kml.cc
+++ b/kml.cc
@@ -485,7 +485,7 @@ void gx_trk_e(xg_string, const QXmlStreamAttributes*)
   // In gx:Track elements all kml:when elements are required to precede all gx:coord elements.
   // For both we allow any order.  Many writers using gx:Track elements don't adhere to the schema.
   while (!gx_trk_times->isEmpty()) {
-    Waypoint* trkpt = new Waypoint;
+    auto* trkpt = new Waypoint;
     trkpt->SetCreationTime(gx_trk_times->takeFirst());
     double lat, lon, alt;
     int n;
index 6d0c0bdbd588c2508b3c26d0a8e22f32017b5927..b838407e977e5c358fe792470935eea988e2c1e2 100644 (file)
@@ -1115,7 +1115,7 @@ lowranceusr_parse_waypts()
   }
 
   for (int i = 0; i < NumWaypoints && !gbfeof(file_in); i++) {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     switch (reading_version) {
     case 2:
@@ -1163,7 +1163,7 @@ lowranceusr_parse_route()
 
   /* waypoints */
   for (int j = 0; j < num_legs; j++) {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
     if (global_opts.debug_level == 99) {
       printf(MYNAME " parse_route:");
     }
@@ -1326,7 +1326,7 @@ lowranceusr_parse_icons()
     int    icon_number = gbfgetint32(file_in);
 
     if (opt_ignoreicons == nullptr) {          /* Option not specified if NULL */
-      Waypoint* wpt_tmp = new Waypoint;
+      auto* wpt_tmp = new Waypoint;
 
       /* position coord lat & long */
       wpt_tmp->latitude = latitude;
@@ -1394,7 +1394,7 @@ lowranceusr_parse_trail(int* trail_num)
       }
 
       for (int j = 0; j < num_section_points && !gbfeof(file_in); j++, num_trail_points--) {
-        Waypoint* wpt_tmp = new Waypoint;
+        auto* wpt_tmp = new Waypoint;
         wpt_tmp->latitude = lat_mm_to_deg(gbfgetint32(file_in));
         wpt_tmp->longitude = lon_mm_to_deg(gbfgetint32(file_in));
 
@@ -1528,7 +1528,7 @@ lowranceusr4_parse_trail(int* trail_num)
     }
   }
   for (int j = 0; j < num_trail_pts; ++j) {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     /* Some unknown bytes */
     gbfgetint16(file_in);
index 61cf77b2273dc36f644af7ace15f16cf2a1ec4a4..867947d6272931a239ddd409d79b70bf1d32cd7e 100644 (file)
--- a/maggeo.cc
+++ b/maggeo.cc
@@ -97,7 +97,7 @@ maggeo_read()
     buff += 9; /* skip field no. 1 */
     int fld = 1;
 
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
     geocache_data* gcdata = wpt_tmp->AllocGCData();
 
     while ((s = csv_lineparse(buff, ",", "", fld++))) {
index 4e68834b1f3c8ecbb6fa80dfc9d7517f69796608..a96301ca4ff5b0d091272099b1830baf6f793ea8 100644 (file)
@@ -972,7 +972,7 @@ mag_trkparse(char* trkmsg)
   int fracsecs;
   struct tm tm;
 
-  Waypoint* waypt = new Waypoint;
+  auto* waypt = new Waypoint;
 
   memset(&tm, 0, sizeof(tm));
 
@@ -1092,7 +1092,7 @@ mag_rteparse(char* rtemsg)
       *p = '\0';
     }
 
-    mag_rte_elem* rte_elem = new mag_rte_elem;
+    auto* rte_elem = new mag_rte_elem;
 
     rte_elem->wpt_name = next_stop;
     rte_elem->wpt_icon = abuf;
@@ -1140,7 +1140,7 @@ mag_rteparse(char* rtemsg)
        */
       foreach (const Waypoint* waypt, rte_wpt_tmp) {
         if (waypt->shortname == re->wpt_name) {
-          Waypoint* wpt = new Waypoint(*waypt);
+          auto* wpt = new Waypoint(*waypt);
           route_add_wpt(rte_head, wpt);
           break;
         }
@@ -1208,7 +1208,7 @@ mag_wptparse(char* trkmsg)
   descr[0] = 0;
   icon_token[0] = 0;
 
-  Waypoint* waypt = new Waypoint;
+  auto* waypt = new Waypoint;
 
   sscanf(trkmsg,"$PMGNWPL,%lf,%c,%lf,%c,%d,%c,%[^,],%[^,]",
          &latdeg,&latdir,
index dee405b1579020279d6f10c67d9ffdafa5426e22..612e74ff5c12c890e39db7884a8616d4c7258c2f 100644 (file)
@@ -114,7 +114,7 @@ tr7_read()
       continue;
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->latitude = lat;
     wpt->longitude = lon;
index f9165a5610092bbd1d3325f501c2968c72cd4254..c774a54e2ab2d4343eb0eade4391e8ac011c66d5 100644 (file)
@@ -69,7 +69,7 @@ read_waypoint()
   int longitude = gbfgetint32(fin);
   int latitude = gbfgetint32(fin);
 
-  Waypoint* ret = new Waypoint;
+  auto* ret = new Waypoint;
 
   ret->latitude = double(latitude)/DIV_RATE;
   ret->longitude = double(longitude)/DIV_RATE;
index b8e3ccd101fac1abd2fa9dafaa91d8640fa4a7e7..b21dea8da807199fae7ecedddfce2e92328e1a14 100644 (file)
@@ -202,7 +202,7 @@ mapsend_track_read()
   unsigned int trk_count = gbfgetuint32(mapsend_file_in);
 
   while (trk_count--) {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     wpt_tmp->longitude = gbfgetdbl(mapsend_file_in);
     wpt_tmp->latitude = -gbfgetdbl(mapsend_file_in);
index 60e0796c5ab15900eb437213f5ea859eb5117bcc..b67535e6d7cab916c6daa03d7d8b710a73405a8c 100644 (file)
@@ -153,7 +153,7 @@ mps_find_wpt_q_by_name(const QList<Waypoint *>* whichQueue, const QString& name)
 static void
 mps_wpt_q_add(QList<Waypoint *>* whichQueue, const Waypoint* wpt)
 {
-  Waypoint* written_wpt = new Waypoint(*wpt);
+  auto* written_wpt = new Waypoint(*wpt);
   whichQueue->append(written_wpt);
 }
 
@@ -511,7 +511,7 @@ mps_waypoint_r(gbfile* mps_file, int mps_ver, Waypoint** wpt, unsigned int* mpsc
   double mps_proximity = unknown_alt;
   double mps_depth = unknown_alt;
 
-  Waypoint* thisWaypoint = new Waypoint;
+  auto* thisWaypoint = new Waypoint;
   *wpt = thisWaypoint;
 
   mps_readstr(mps_file, wptname, sizeof(wptname));
diff --git a/mmo.cc b/mmo.cc
index cce4cfdbc19f0833475b57315ff110f281fd9b05..37458e4bb2520d800f5e90d927397d41d38be005 100644 (file)
--- a/mmo.cc
+++ b/mmo.cc
@@ -647,7 +647,7 @@ mmo_read_CObjTrack(mmo_data_t* data)
   DBG((sobj, "track has %d point(s)\n", tp));
 
   for (int ctp = 0; ctp < tp; ctp++) {
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->latitude = gbfgetdbl(fin);
     wpt->longitude = gbfgetdbl(fin);
index 50ef8c56e5cf75cf8ef81d89b18d5d530947f69a..ea129750489483699c8b46978661d9f2534bff21 100644 (file)
@@ -803,7 +803,7 @@ mtk_retry:
 static route_head*  trk_head = nullptr;
 static int add_trackpoint(int idx, unsigned long bmask, struct data_item* itm)
 {
-  Waypoint* trk = new Waypoint;
+  auto* trk = new Waypoint;
 
   if (global_opts.masked_objective& TRKDATAMASK && (trk_head == nullptr || (mtk_info.track_event & MTK_EVT_START))) {
     char spds[50];
@@ -899,7 +899,7 @@ static int add_trackpoint(int idx, unsigned long bmask, struct data_item* itm)
          )
      ) {
     /* Button press -- create waypoint, start count at 1 */
-    Waypoint* w = new Waypoint(*trk);
+    auto* w = new Waypoint(*trk);
 
     w->shortname = QString::asprintf("WP%06d", waypt_count()+1);
     waypt_add(w);
index 7e84ca20d36ec67e8483ab4bfd7ec95ff5798f7c..29830f9ee046ecc1943556ae7c5e8f6fea14d168 100644 (file)
--- a/mynav.cc
+++ b/mynav.cc
@@ -83,7 +83,7 @@ MyNavFormat::read_line(const QString& line, route_head* track)
     return;
   }
 
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
   wpt->latitude = val_lat;
   wpt->longitude = val_lon;
 
index 926ed9e52619b3364dd3cc496bfea27709b7014e..c6d1746f4133f1fd72ff9256f8949e65c163a3af 100644 (file)
@@ -97,7 +97,7 @@ static void
 NaviReadCache(const QXmlStreamReader& reader)
 {
   const QXmlStreamAttributes a = reader.attributes();
-  Waypoint* wpt_tmp = new Waypoint;
+  auto* wpt_tmp = new Waypoint;
   geocache_data* gc_data = wpt_tmp->AllocGCData();
   if (a.hasAttribute("cache_id")) {
     int n = a.value("cache_id").toString().toInt();
index b31c47309a902163be750f835ecb75dc25ca6db9..fee072391e18ff3fe5c444667dcd6cfebf753470 100644 (file)
@@ -368,7 +368,7 @@ data_read()
 
   for (int n = 0; n < nof_wp; ++n) {
 
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     /* Read waypoint data */
 
index 67acafee7c1e8ea1d588663d2b17b34d8254565a..cc69a7c46a3c00d11fd1a87b45a25c52583b7f3e 100644 (file)
@@ -397,7 +397,7 @@ decode_waypoint_id(const unsigned char* buffer)
 static Waypoint*
 decode_waypoint(const unsigned char* buffer)
 {
-  Waypoint* waypt = new Waypoint;
+  auto* waypt = new Waypoint;
 
   decode_position(buffer + 12, waypt);
   char* s = xstrdup((char*)buffer + 4);
@@ -429,7 +429,7 @@ encode_waypoint(const Waypoint* waypt, unsigned char* buffer)
 static Waypoint*
 decode_trackpoint(const unsigned char* buffer)
 {
-  Waypoint* waypt = new Waypoint;
+  auto* waypt = new Waypoint;
 
   decode_position(buffer + 12, waypt);
   waypt->SetCreationTime(decode_datetime(buffer + 22));
@@ -813,7 +813,7 @@ decode_sbp_position(const unsigned char* buffer, Waypoint* waypt)
 Waypoint*
 navilink_decode_logpoint(const unsigned char* buffer)
 {
-  Waypoint* waypt = new Waypoint;
+  auto* waypt = new Waypoint;
 
   waypt->hdop = (buffer[0]) * 0.2f;
   waypt->sat = buffer[1];
index f0ce2f2bbfffd44ad91be05dc8fe262de470c79c..645468003c246e6ac99b5f8f3349e5f9f16f6e83 100644 (file)
@@ -57,7 +57,7 @@ navitel_read_track()
     int lon = gbfgetint32(fin);
     int lat = gbfgetint32(fin);
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     wpt->latitude = GPS_Math_Semi_To_Deg(lat & 0x7FFFFFFF);
     wpt->longitude = GPS_Math_Semi_To_Deg(lon);
 
index 1c4679f8e5a06d4eba3f5638fb01925feba60406..ed62bfaa9f1a4f2f1a3c7844e4581308247d4041 100644 (file)
@@ -219,7 +219,7 @@ data_read()
       continue;
     }
 
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     if (stealth) {
       if (!snmac) {
diff --git a/nmn4.cc b/nmn4.cc
index 9a6bddd87e12af7aac9facac488ea26a8d82fc40..3a8134f8b7fd1fc391fbf22d20cdc9208222d20a 100644 (file)
--- a/nmn4.cc
+++ b/nmn4.cc
@@ -85,7 +85,7 @@ nmn4_read_data()
     /* for a quiet compiler */
     QString zip1 = zip2 = city = street = number = QString();
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     int column = -1;
     QString c = csv_lineparse(str, "|", "", column++);
diff --git a/osm.cc b/osm.cc
index 4f4ae906080609c044b4edcdef453f31bf254f58..784a6bf5c57b64de8cd47ec1bf06106cdb216497 100644 (file)
--- a/osm.cc
+++ b/osm.cc
@@ -591,7 +591,7 @@ osm_way_nd(xg_string, const QXmlStreamAttributes* attrv)
 
     if (waypoints.contains(atstr)) {
       const Waypoint* ctmp = waypoints.value(atstr);
-      Waypoint* tmp = new Waypoint(*ctmp);
+      auto* tmp = new Waypoint(*ctmp);
       route_add_wpt(rte, tmp);
     } else {
       warning(MYNAME ": Way reference id \"%s\" wasn't listed under nodes!\n", qPrintable(atstr));
diff --git a/ozi.cc b/ozi.cc
index cfcbf5c414bebd46f58afdf6ca1cccab4b5c9d25..67cf60ac3edac94ebb074f4d14002f7ece79b8e6 100644 (file)
--- a/ozi.cc
+++ b/ozi.cc
@@ -787,7 +787,7 @@ data_read()
     if (buff.contains(',')) {
       bool ozi_fsdata_used = false;
       ozi_fsdata* fsdata = ozi_alloc_fsdata();
-      Waypoint* wpt_tmp = new Waypoint;
+      auto* wpt_tmp = new Waypoint;
 
       /* data delimited by commas. */
       const QStringList parts = buff.split(',');
index 8e7c136efd5b699534622770aebe78431fc32da1..d8ee1b117ef594b2bf83a066c7965b80d128d0ec 100644 (file)
@@ -103,7 +103,7 @@ read_tracks()
     tm.tm_min = le_readu16(&bc.minute);
     tm.tm_sec = le_readu16(&bc.second);
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     wpt->latitude = le_read_float(&bc.latitude);
     wpt->longitude = le_read_float(&bc.longitude);
     wpt->altitude = FEET_TO_METERS(le_read_float(&bc.altitude));
index f03eaba2ba1c4f2a500822977b96349fc273566c..40ffd3ac12131dee00d5fc9e1f2b814b87e92405 100644 (file)
@@ -65,7 +65,7 @@ data_read()
       break;
     }
     linecount++;
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     char* s = buff;
     s = csv_lineparse(s, "\\w", "", linecount);
     if (!s) {
index c83e13093e9f67ae52d0253da79d9fbb9c1b35d6..afdc4bb425ea7d7ce500368cf730caa4881326bb 100644 (file)
@@ -303,7 +303,7 @@ static void
 psit_waypoint_r(gbfile* psit_file, Waypoint**)
 {
   if (strlen(psit_current_token) > 0) {
-    Waypoint* thisWaypoint = new Waypoint;
+    auto* thisWaypoint = new Waypoint;
 
     thisWaypoint->latitude = atof(psit_current_token);
 
@@ -409,7 +409,7 @@ psit_route_r(gbfile* psit_file, route_head** rte)
 
   while (psit_isKnownToken(psit_current_token) != 0) {
     if (strlen(psit_current_token) > 0) {
-      Waypoint* thisWaypoint = new Waypoint;
+      auto* thisWaypoint = new Waypoint;
 
       thisWaypoint->latitude = atof(psit_current_token);
 
@@ -523,7 +523,7 @@ psit_track_r(gbfile* psit_file, route_head**)
 
   while (psit_isKnownToken(psit_current_token) != 0) {
     if (strlen(psit_current_token) > 0) {
-      Waypoint* thisWaypoint = new Waypoint;
+      auto* thisWaypoint = new Waypoint;
 
       thisWaypoint->latitude = atof(psit_current_token);
 
index c4f5a87282dd68e60c6c893d08dc69963c37b9f6..60a11ae49c90560606898b3c9b0508128c8450be 100644 (file)
@@ -200,7 +200,7 @@ raymarine_read()
       break;
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     wpt->shortname = name;
     wpt->latitude = lat.toDouble();
     wpt->longitude = lon.toDouble();
diff --git a/sbn.cc b/sbn.cc
index 2cb4bba4f84ce53826771b89d21872b920336cb2..9610ade3f7cb8c8a8b3a79f3d21fd3fc9e2e1bd1 100644 (file)
--- a/sbn.cc
+++ b/sbn.cc
@@ -235,7 +235,7 @@ decode_sbn_position(const unsigned char* buffer, Waypoint* waypt)
 static Waypoint*
 decode_sbn_record(unsigned char* buffer)
 {
-  Waypoint* waypt = new Waypoint;
+  auto* waypt = new Waypoint;
 
   if (is_sbn_valid(buffer)) {
     waypt->fix = decode_sbn_mode(buffer + 3);
index 80faa2f536c7eecabcbf17c4924ecedee140a691..edb7ae0dc108ba0c1b7f2323f5be9d1339459698 100644 (file)
@@ -47,7 +47,7 @@ skyforce_parse_coords(const char* str)
     fatal(MYNAME ": Incomplete line!\n");
   }
 
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
 
   wpt->latitude = atof(str + 21);
   if (str[20] == 'S') {
index 248c56ecc29115937261095654f89bb31af449b4..520123f9084f0b77939a635f4accb5cd1ce9c31e 100644 (file)
@@ -694,7 +694,7 @@ state_init(struct read_state* pst)
 static Waypoint*
 make_trackpoint(struct read_state* st, double lat, double lon, double alt)
 {
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
 
   wpt->shortname = QString::asprintf("TP%04d", ++st->tpn);
 
@@ -1561,7 +1561,7 @@ static void miniHomer_get_poi()
     } else {
       ECEF_to_LLA(ecef_x, ecef_y, ecef_z, &lat, &lng, &alt);
 
-      Waypoint* wpt = new Waypoint;
+      auto* wpt = new Waypoint;
       wpt->shortname      = QString::asprintf("POI_%s", poinames[poi]);
       wpt->description    = QString::asprintf("miniHomer points to this coordinates if the %s symbol is on", poinames[poi]);
       wpt->latitude       = lat;
index 6fa5ab9fd9e0c1eb9eca617114d276e8d22cc73d..b54ea3d228e8628a70921d06eb8cb4a2ecb5bec8 100644 (file)
@@ -205,7 +205,7 @@ waypoint_final()
 
   if (route != nullptr) {
     if ((via != 0) || (routevia == nullptr)) {
-      Waypoint* wpt = new Waypoint(*wpt_tmp);
+      auto* wpt = new Waypoint(*wpt_tmp);
       route_add_wpt(route, wpt);
     }
   }
index 03d5214ac79419090d6e8b7d64fb6319f7917bbe..da1c6c5b02d1708baded9671f8e5857286275725 100644 (file)
@@ -57,7 +57,7 @@ static void
 teletype_read()
 {
   for (uint32_t i = 0; i < tty_wpt_count; i++) {
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     wpt->shortname = (gbfgetcstr(fin));
     wpt->description = (gbfgetcstr(fin));
 
index df934a5bef1eb238bb2c9739b1f1326a07e86287..a83736778bdb7dc63e2144faf020bb8f50d228ad 100644 (file)
--- a/tiger.cc
+++ b/tiger.cc
@@ -166,7 +166,7 @@ data_read()
     }
     if (sscanf(ibuf, "%lf,%lf:%100[^:]:%100[^\n]",
                &lon, &lat, icon, desc)) {
-      Waypoint* wpt_tmp = new Waypoint;
+      auto* wpt_tmp = new Waypoint;
 
       wpt_tmp->longitude = lon;
       wpt_tmp->latitude = lat;
index b968e49538ffe5a61084cf6756c67ab8004c97f3..f00423416bb22b6bee92938b14a7f104c277effb 100644 (file)
--- a/tmpro.cc
+++ b/tmpro.cc
@@ -80,7 +80,7 @@ data_read()
     /* skip the line if it contains "sHyperLink" as it is a header (I hope :) */
     if ((strlen(buff)) && (strstr(buff, "sHyperLink") == nullptr)) {
 
-      Waypoint* wpt_tmp = new Waypoint;
+      auto* wpt_tmp = new Waypoint;
 
       /* data delimited by tabs, not enclosed in quotes.  */
       char* s = buff;
diff --git a/tpg.cc b/tpg.cc
index 143b9e940d5e95eb655474a7fd9165127de0ddde..f2b1760be82d81f1aa62f12385f80e54fafd1752 100644 (file)
--- a/tpg.cc
+++ b/tpg.cc
@@ -113,7 +113,7 @@ tpg_read()
 
 
   while (pointcount--) {
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     /* pascal-like shortname */
     wpt_tmp->shortname = gbfgetpstr(tpg_file_in);
diff --git a/tpo.cc b/tpo.cc
index 709c0cd820ec2f9aa0c063ea2019b85e9c1a241b..b80f93e62aaf5f222af34d00798eced247eda4e5 100644 (file)
--- a/tpo.cc
+++ b/tpo.cc
@@ -338,7 +338,7 @@ static void tpo_read_2_x()
     /* multiply all the deltas by the scaling factors to determine the waypoint positions */
     for (int j = 0; j < waypoint_count; j++) {
 
-      Waypoint* waypoint_temp = new Waypoint;
+      auto* waypoint_temp = new Waypoint;
       double amt;
       /* convert incoming NAD27/CONUS coordinates to WGS84 */
       GPS_Math_Known_Datum_To_WGS84_M(
@@ -447,7 +447,7 @@ static int tpo_find_block(unsigned int block_desired)
 //
 static Waypoint* tpo_convert_ll(int lat, int lon)
 {
-  Waypoint* waypoint_temp = new Waypoint;
+  auto* waypoint_temp = new Waypoint;
 
   double latitude = (double)lat / 0x800000;
   double longitude = (double)lon / 0x800000;
@@ -857,7 +857,7 @@ static void tpo_process_waypoints()
 
     // For routes (later), we need a duplicate of each waypoint
     // indexed by the order we read them in.
-    Waypoint* waypoint_temp2 = new Waypoint(*waypoint_temp);
+    auto* waypoint_temp2 = new Waypoint(*waypoint_temp);
 
     // Attach the copy to our index
     tpo_wp_index[tpo_index_ptr++] = waypoint_temp2;
@@ -1162,7 +1162,7 @@ static void tpo_process_routes()
 //printf("val: %x\t\t", val);
 
       // Duplicate a waypoint from our index of waypoints.
-      Waypoint* waypoint_temp = new Waypoint(*tpo_wp_index[val-1]);
+      auto* waypoint_temp = new Waypoint(*tpo_wp_index[val-1]);
 
       // Add the waypoint to the route
       route_add_wpt(route_temp, waypoint_temp);
index 7877a3ffded5411d7231d944b57b4342b05bae52..29a2ad111547737d31acd47c9dacbad85d52e201 100644 (file)
@@ -95,7 +95,7 @@ void TransformFilter::transform_trk_disp_hdr_cb(const route_head* trk)
 
 void TransformFilter::transform_any_disp_wpt_cb(const Waypoint* wpt)
 {
-  Waypoint* temp = new Waypoint(*wpt);
+  auto* temp = new Waypoint(*wpt);
   if (current_target == 'R') {
     route_add_wpt(current_rte, temp, current_namepart, name_digits);
   } else if (current_target == 'T') {
index b9c2f2654ec2f4968ab9918bfffed62f3438ec5a..cd0758499c3151f7cf2fbf5005666f439ddac7b6 100644 (file)
--- a/unicsv.cc
+++ b/unicsv.cc
@@ -624,7 +624,7 @@ unicsv_parse_one_line(const QString& ibuf)
   int ns = 1;
   int ew = 1;
   geocache_data* gc_data = nullptr;
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
   wpt->latitude = unicsv_unknown;
   wpt->longitude = unicsv_unknown;
   memset(&ymd, 0, sizeof(ymd));
diff --git a/v900.cc b/v900.cc
index 18e76adcf7db477c20bd198b1c02a1ce9b81fb70..2867dc638d98bae13aae6a4a98a13871df7dd0d6 100644 (file)
--- a/v900.cc
+++ b/v900.cc
@@ -288,7 +288,7 @@ v900_read()
       line.bas.cr = 0; /* null terminate vox field */
     }
 
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     /* lat is a string in the form: 31.768380N */
     char c = line.bas.common.latitude_NS;      /* N/S */
@@ -348,7 +348,7 @@ v900_read()
       // thread on gpsbabel-misc with Jamie Robertson.
       assert(line.bas.common.tag == 'C' || line.bas.common.tag == 'G' ||
              line.bas.common.tag == 'V');
-      Waypoint* wpt2 = new Waypoint(*wpt);
+      auto* wpt2 = new Waypoint(*wpt);
       if (line.bas.common.tag == 'V') {        // waypoint with voice recording?
         char vox_file_name[sizeof(line.adv.vox)+5];
         const char* vox = is_advanced_mode ? line.adv.vox : line.bas.vox;
index df8aea48410b783d827750fc8fff9ce2646b13c4..6d0fd16e0dc6fdfec0238ee0c645f7597c05ac79 100644 (file)
@@ -76,7 +76,7 @@ vidaone_read()
   route_head* trk = nullptr;
 
   while (! gbfeof(fin)) {
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
 
     wpt->latitude = gbfgetdbl(fin);
     wpt->longitude = gbfgetdbl(fin);
index acebc352388e2b084a5ba58f3fefd9db3f942758..53830777fe449ff87261abcf38530b1d0f9917ce 100644 (file)
@@ -126,7 +126,7 @@ vitosmt_read()
     unsigned char gpsvalid = gbfgetc(infile); /* fix is valid */
     unsigned char gpssats = gbfgetc(infile); /* number of sats */
 
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     wpt_tmp->latitude =DEG(latrad);
     wpt_tmp->longitude =DEG(lonrad);
index 8f7b06fbd612f1de6c725f714d97a8b71f8db6b5..f5b91fb2ef86881eee2c5005e00cbd6f38f64f8d 100644 (file)
@@ -88,7 +88,7 @@ vitovtt_read()
     int course = gbfgetint16(infile);
     int status = gbfgetint32(infile);
 
-    Waypoint* wpt_tmp = new Waypoint;
+    auto* wpt_tmp = new Waypoint;
 
     wpt_tmp->latitude= scaled_lat / vitovtt_latitudescale;
     wpt_tmp->longitude= scaled_lon / vitovtt_longitudescale;
diff --git a/vpl.cc b/vpl.cc
index 542d65d86e1b6ba8e6aab9536a2cbcee917ec212..6f9d7cfc1d2703ca035edc27fe2e7d827a667988 100644 (file)
--- a/vpl.cc
+++ b/vpl.cc
@@ -186,7 +186,7 @@ vpl_parse_75_sentence(const char* ibuf)
   ymd /= 100;
   tm.tm_year = ymd % 100 + 100;
 
-  Waypoint* waypt = new Waypoint;
+  auto* waypt = new Waypoint;
 
   // Lat/Lon are both stored *0xE1000 which we have to divide out
   // for decimal degrees
index f8597db575ca53fcce34ea650e0d9d8caacc576a..f4cd9fa5dd6ff89961947788b65c15ff7a85ef74 100644 (file)
@@ -537,7 +537,7 @@ static int check_date(uint32_t tim)
 static Waypoint* make_point(double lat, double lon, double alt, time_t tim, const char* fmt, int index)
 {
   char     wp_name[20];
-  Waypoint* wpt = new Waypoint;
+  auto* wpt = new Waypoint;
 
   sprintf(wp_name, fmt, index);
 
index 6708623d02ce3e0c93af2202ff12f821b038a238..44428c0f97d10a1876102ce22180dce15f6342c0 100644 (file)
@@ -152,7 +152,7 @@ void wfff_e(xg_string, const QXmlStreamAttributes*)
   char         desc[255]       ="\0";
 
   if ((ap_hdop>=1)&&(ap_hdop<50)) { // Discard invalid GPS fix
-    Waypoint*  wpt_tmp = new Waypoint;
+    auto*      wpt_tmp = new Waypoint;
 
     if (snmac) {
       wpt_tmp->shortname = ap_mac;
index 1373af9435506f718bf6bedf4a18b4e791c2786e..c5b53aa3d2525343d79b3db5b055d020acfe87cf 100644 (file)
@@ -67,7 +67,7 @@ wintec_tes_read()
     int16_t alt = gbfgetint16(fin);  // Signed.  Meters.
 
     (void) flags; // Silence 'unused' warning until we use flags.
-    Waypoint* wpt = new Waypoint;
+    auto* wpt = new Waypoint;
     wpt->latitude = latitude / 1.0e7;
     wpt->longitude = longitude / 1.0e7;
     wpt->SetCreationTime(wintec_date_to_time(date));
@@ -84,7 +84,7 @@ wintec_tes_read()
     //  Wintec's software puts a waypoint in the track, so we
     //  mock that.
     if (flags &  0x02) {
-      Waypoint* temp = new Waypoint(*wpt);
+      auto* temp = new Waypoint(*wpt);
       waypt_add(temp);
     }
 
diff --git a/xcsv.cc b/xcsv.cc
index 733e18cead3c578709c694df3842e7dab4af1bd9..f2d87c3a5194782783b7d65cf08e2ee2d50db609 100644 (file)
--- a/xcsv.cc
+++ b/xcsv.cc
@@ -953,7 +953,7 @@ xcsv_data_read()
        }
     }
     if (!buff.isEmpty()) {
-      Waypoint* wpt_tmp = new Waypoint;
+      auto* wpt_tmp = new Waypoint;
       // initialize parse data for accumulation of line results from all fields in this line.
       xcsv_parse_data parse_data;
       const QStringList values = csv_linesplit(buff, xcsv_style->field_delimiter,
index 6ecbd251e1204a68d8e8fb6adbd8e9f3a0b1918d..99539fa9433fb1115870a0df2f43805ed2bb82ca 100644 (file)
--- a/xmltag.cc
+++ b/xmltag.cc
@@ -48,7 +48,7 @@ copy_xml_tag(xml_tag** copy, xml_tag* src, xml_tag* parent)
     return;
   }
 
-  xml_tag* res = new xml_tag;
+  auto* res = new xml_tag;
   *copy = res;
 
   res->tagname = (src->tagname);
@@ -78,7 +78,7 @@ fs_xml_copy(void** copy, void* source)
     *copy = nullptr;
     return;
   }
-  fs_xml* res = new fs_xml;
+  auto* res = new fs_xml;
   *copy = res;
 
   res->fs = src->fs;
@@ -87,7 +87,7 @@ fs_xml_copy(void** copy, void* source)
 
 fs_xml* fs_xml_alloc(long type)
 {
-  fs_xml* result = new fs_xml;
+  auto* result = new fs_xml;
   result->fs.type = type;
   result->fs.copy = fs_xml_copy;
   result->fs.destroy = fs_xml_destroy;